package Operate;

import BookList.Book;
import BookList.Booklist;

import java.util.Scanner;

/**
 * Created with Intellij IDEA.
 * Description;
 * User:墨琦
 * Data:2023-03-25
 * Time:10:09
 */
public class Findoperate implements IO{
    @Override
    public void work(Booklist book) {
        System.out.println("请输入查找的图书：");
        Scanner sc=new Scanner(System.in);
        String name=sc.nextLine();
        int t=0;
        for(int i=0;i< book.size;i++)
        {
            if(book.getBook(i).getName().equals(name))
            {
                Book fw = book.getBook(i);
                System.out.println(fw);
                t=1;
            }
        }
        if(t==0)
            System.out.println("无此书");
    }
}
